home *** CD-ROM | disk | FTP | other *** search
/ Your Choice 3 / Your Choice Software Collection 3.iso / prgmming / swag05 / mail.swg < prev    next >
Text File  |  1994-09-22  |  2KB  |  1 lines

  1. SWAGOLX.EXE (c) 1993 GDSOFT  ALL RIGHTS RESERVED 00001                                                                           1      05-25-9408:00ALL                      TRYGVE GUDMUNDSEN        Numbers in QWK packets   SWAG9405            17     n¼   {πTH> Apparently this contains the filepositions of the records (and also theπTH> conference numbers?) but the numbers are not in normal format. Can somebodyπTH>  please explain the format of this file and how to convert these numbers toπTH> and from something TP can work with?ππThere is supposed to be at least two doc's explaining the QWK format. I haveπhere a unit that converts the integer to basicreal (i guess it's what youπneed..) I'm sorry I can't remember the of the doc's..ππ------------------- 8<π}πUnit BasConv;ππInterfaceπ  Function BasicReal2Long(InValue: LongInt): LongInt;π                {Convert Basic Short Reals to LongInts}ππ  Function Long2BasicReal(InValue: LongInt): LongInt;π                {Convert LongInts to Basic Short Reals}ππImplementationππFunction BasicReal2Long(InValue: LongInt): LongInt;ππ  Varπ  Temp: LongInt;π  Expon: Integer;ππ  Beginπ  Expon := ((InValue shr 24) and $ff) - 152;π  Temp := (InValue and $007FFFFF) or $00800000;π  If Expon < 0 Thenπ    Temp := Temp shr Abs(Expon)π  Elseπ    Temp := Temp shl Expon;π  If (InValue and $00800000) <> 0 Thenπ    BasicReal2Long := -Tempπ  Elseπ    BasicReal2Long := Temp;π  If Expon = 0 Thenπ    BasicReal2Long := 0;π  End;πππFunction Long2BasicReal(InValue: LongInt): LongInt;π  Varπ  Negative: Boolean;π  Expon: LongInt;ππ  Beginπ  If InValue = 0 Thenπ    Long2BasicReal := 0π  Elseπ    Beginπ    If InValue < 0 Thenπ      Beginπ      Negative := True;π      InValue := Abs(InValue);π      Endπ    Elseπ      Negative := False;π    Expon := 152;π    If InValue < $007FFFFF Thenπ      While ((InValue and $00800000) = 0) Doπ        Beginπ        InValue := InValue shl 1;π        Dec(Expon);π        Endπ    Elseπ      While ((InValue And $FF000000) <> 0) Doπ        Beginπ        InValue := InValue shr 1;π        Inc(Expon);π        End;π    InValue := InValue And $007FFFFF;π    If Negative Thenπ      InValue := InValue Or $00800000;π    Long2BasicReal := InValue + (Expon shl 24);π    End;π  End;ππEnd.π